package com.zyj.pojo;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
@Entity
@Table(name="t_asset")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Asset {
	private Integer id;
	private String assetcode;
	private String assetname;
	private String assetmemo;
	private Integer assettype;
	private String assetstatus;
	private Integer isborrow;
	private Integer isvalidate;
	private Integer quantity;
	private String batch;
	private String unit;
	private Date buydate;
	private Date storedate;
	private Integer leavedays;
	private Room room;
	private User user;
	private List<Assetpetition> assetpetitionList;
	private List<Category> categoryList;
	
	@Id
	@GeneratedValue(strategy=IDENTITY)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getAssetcode() {
		return assetcode;
	}
	public void setAssetcode(String assetcode) {
		this.assetcode = assetcode;
	}
	public String getAssetname() {
		return assetname;
	}
	public void setAssetname(String assetname) {
		this.assetname = assetname;
	}
	public String getAssetmemo() {
		return assetmemo;
	}
	public void setAssetmemo(String assetmemo) {
		this.assetmemo = assetmemo;
	}
	public Integer getAssettype() {
		return assettype;
	}
	public void setAssettype(Integer assettype) {
		this.assettype = assettype;
	}
	public String getAssetstatus() {
		return assetstatus;
	}
	public void setAssetstatus(String assetstatus) {
		this.assetstatus = assetstatus;
	}
	public Integer getIsborrow() {
		return isborrow;
	}
	public void setIsborrow(Integer isborrow) {
		this.isborrow = isborrow;
	}
	public Integer getIsvalidate() {
		return isvalidate;
	}
	public void setIsvalidate(Integer isvalidate) {
		this.isvalidate = isvalidate;
	}
	public Integer getQuantity() {
		return quantity;
	}
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}
	public String getBatch() {
		return batch;
	}
	public void setBatch(String batch) {
		this.batch = batch;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public Date getBuydate() {
		return buydate;
	}
	public void setBuydate(Date buydate) {
		this.buydate = buydate;
	}
	public Date getStoredate() {
		return storedate;
	}
	public void setStoredate(Date storedate) {
		this.storedate = storedate;
	}
	public Integer getLeavedays() {
		return leavedays;
	}
	public void setLeavedays(Integer leavedays) {
		this.leavedays = leavedays;
	}
	@ManyToOne
	@JoinColumn(name="roomid")
	public Room getRoom() {
		return room;
	}
	public void setRoom(Room room) {
		this.room = room;
	}
	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@OneToMany(mappedBy="asset")
	public List<Assetpetition> getAssetpetitionList() {
		return assetpetitionList;
	}
	public void setAssetpetitionList(List<Assetpetition> assetpetitionList) {
		this.assetpetitionList = assetpetitionList;
	}
	@ManyToMany(targetEntity=com.zyj.pojo.Category.class,mappedBy="assetList")
	public List<Category> getCategoryList() {
		return categoryList;
	}
	public void setCategoryList(List<Category> categoryList) {
		this.categoryList = categoryList;
	}

}
